# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=lottieconverter
pkgver=0.2_git20231219
_gitrev=3ad34af7bbcf9197fda782a5832b18b72a3bb939
pkgrel=0
pkgdesc="Simple, dummy lottie converter"
url="https://github.com/sot-tech/LottieConverter"
arch="all"
license="BSD-3-Clause"
makedepends="
	cmake
	giflib-dev
	libpng-dev
	rlottie-dev
	samurai
	zlib-dev
"
subpackages="$pkgname-doc"
source="
	$pkgname-$_gitrev.tar.gz::https://github.com/sot-tech/LottieConverter/archive/$_gitrev.tar.gz
"
builddir="$srcdir/LottieConverter-$_gitrev"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=Release \
		-DSYSTEM_GL=1 \
		-DSYSTEM_RL=1

	cmake --build build
}

check() {
	ctest --test-dir build -C Release --output-on-failure
}

package() {
	install -Dm755 build/lottieconverter -t "$pkgdir"/usr/bin

	install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/lottieconverter/LICENSE
}

sha512sums="
770b305ecb843807a2519094f090c092baee56a572b7e52c7d6cde079c179e6aa57ebdabf8448cbbaedda7b7ae9f6f0552389b900bae2b3de00eca8ea9408d45  lottieconverter-3ad34af7bbcf9197fda782a5832b18b72a3bb939.tar.gz
"
